package com.tengju.data.domain.model.activity;

import lombok.AllArgsConstructor;

/**
 * @author: 大木
 * @date: 2021/10/13 4:04 下午
 */
@AllArgsConstructor
public enum KanbanType {

    OWN_KANBAN(10,"个人看板"),
    COMPOSITE_KANBAN(20,"大盘看板"),
    ;

    private final Integer val;
    private final String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static KanbanType fromVal(Integer val) {
        for (KanbanType type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }


    public static KanbanType fromName(String name) {
        for (KanbanType type : values()) {
            if (type.name().equals(name)) {
                return type;
            }
        }
        return null;
    }


}
